package com.example.designpatterns.model.observer.eventbus;

import com.example.designpatterns.model.observer.demo.PromotionService;
import org.springframework.stereotype.Service;

/**
 * @author yanyun zhu
 * @version 1.0
 * @date 2022/1/4 13:40
 */
@Service
public class RegPromotionObserver {
    private PromotionService promotionService; // 依赖注入

    @Subscribe
    public void handleRegSuccess(Long userId) {
        System.out.println("RegPromotionObserver");
        promotionService.issueNewUserExperienceCash(userId);
    }
}